package top.chenfu1201.clientApi.controller.jpa;

import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RequestMapping("/jpa/user")
@RestController(value = "jpaUserController")
public class UserController {

    @Autowired
    private RestTemplate restTemplate;

    @Value("${mapper.base.user.url}")
    public String baseMapperUrl;

    @GetMapping("/queryAll")
    public Object queryAll() {
        return this.restTemplate.getForObject(baseMapperUrl + "queryAll", JSONArray.class);
    }

}
